<?php
/**
 * SaleViewModel
 *
 * @author Mike Gao
 */
class OrderViewModel extends ViewModel{
    protected $pk  = 'Sale.id';

    public $viewFields = array(
    	'Order' => array('*','_as'=>'Sale'),
        'Customer' => array('concat(Customer.company,"; ",Customer.name)'=>'customer_info','name'=>'customer','company'=>'customer_company', '_on' => 'Sale.customer_id = Customer.id'),
        'Order_detail' => array('id'=>'did','charge_man','number', 'price','cost'=>'dcost','specification','mano'=>'dmano','delivery_date','priority','remark'=>'dremark','total'=>'dtotal','cost'=>'dcost','to_first_pay'=>'dto_first_pay','to_remain_pay'=>'dto_remain_pay','should_pay'=>'dshould_pay','first_pay'=>'dfirst_pay','remain_pay'=>'dremain_pay','real_pay'=>'dreal_pay','receipt_status'=>'dreceipt_status','create_time'=>'dctime','logifee'=>'dlogifee','update_time'=>'dutime','status'=>'dstatus','first_pay_time','remain_pay_time','back_money_time','_on' => 'Sale.id = Order_detail.order_id'),
        'Product' => array('id'=>'pid', 'name','ename', 'cas','unit_id','_on' => 'Order_detail.product_id = Product.id'),
        
    );


}
?>
